package com.prj.ufdm.file.enums;

/**
 * 授权模块返回码（编码规则：04 + 2位功能编号  + 3位错误编号）
 * @author 胡义振
 * @date 2018-03-18
 */
public enum UpFileRetCodeEnum {
	
	RET_CODE_0401001("0401001",""),
	RET_CODE_0401002("0401002","未能成功创建文件目录"),
	RET_CODE_0401003("0401003","文件名称不正确"),
	RET_CODE_0401004("0401004","文件类型不正确"),
	RET_CODE_0401005("0401005","文件大小不正确"),
	RET_CODE_0401006("0401006","不允许上传的文件"),
	
	RET_CODE_0401007("0401007","文件名不能为空"),
	RET_CODE_0401008("0401008","文件类型不能为空"),
	RET_CODE_0401009("0401009","文件Hash不能为空"),
	RET_CODE_0401010("0401010","文件大小不能为空"),
	RET_CODE_0401011("0401011","文件不能为空"),
	RET_CODE_0401012("0401012","WhileFileId不能为空"),
	RET_CODE_0401013("0401013","chunkNum不能为空"),
	RET_CODE_0401014("0401014","chunkSize不能为空"),
	
	RET_CODE_0401999("0401999","文件上传出现异常"),
	
	
	RET_CODE_0402001("0402001","文件ID不能为空"),
	RET_CODE_0402002("0402002","文件不存在"),
	RET_CODE_0402999("0402999","文件下载出现异常");
	
	private String code;
	private String message;
	
	
	UpFileRetCodeEnum(String code,String message){
		this.code = code;
		this.message = message;
	}
	
	public static String getRetCodeName(String retErrCode){
		String rtnRetErrCode = "";
		for (UpFileRetCodeEnum authRetCodeEnum : UpFileRetCodeEnum.values()) {
			if(authRetCodeEnum.code.equals(retErrCode)){
				rtnRetErrCode = authRetCodeEnum.message;
			}
	    }
		return rtnRetErrCode;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}


}
